<html>
<head><meta charset="utf-8"><title>Docstring brigade · project-portable-simd · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/index.html">project-portable-simd</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html">Docstring brigade</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="241649773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241649773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241649773">(Jun 05 2021 at 18:24)</a>:</h4>
<p>Alright, any one around here to bounce some silly questions here?</p>



<a name="241650039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241650039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241650039">(Jun 05 2021 at 18:29)</a>:</h4>
<p>sure.</p>



<a name="241651155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241651155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241651155">(Jun 05 2021 at 18:54)</a>:</h4>
<p>Weird, can't run <code>cargo test --quiet --doc</code></p>



<a name="241651286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241651286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241651286">(Jun 05 2021 at 18:57)</a>:</h4>
<p>huh.</p>



<a name="241651297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241651297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241651297">(Jun 05 2021 at 18:57)</a>:</h4>
<p>OH right!<br>
doc tests are really different unfortunately. :(</p>



<a name="241651302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241651302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241651302">(Jun 05 2021 at 18:57)</a>:</h4>
<p>for... no _really_ good reason.</p>



<a name="241651303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241651303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241651303">(Jun 05 2021 at 18:57)</a>:</h4>
<p>:(</p>



<a name="241651354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241651354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241651354">(Jun 05 2021 at 18:58)</a>:</h4>
<p>Can't do <code>cargo test --test-threads 8 --doc</code> either :(</p>



<a name="241651366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241651366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241651366">(Jun 05 2021 at 18:58)</a>:</h4>
<p>iirc they're basically compiled as one big chunk instead of like most tests.</p>



<a name="241651369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241651369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241651369">(Jun 05 2021 at 18:58)</a>:</h4>
<p>which are separate.</p>



<a name="241651395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241651395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241651395">(Jun 05 2021 at 18:59)</a>:</h4>
<p>So try to keep all doctest examples as fairly terse. ^^;</p>



<a name="241651406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241651406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241651406">(Jun 05 2021 at 18:59)</a>:</h4>
<p>Right - I'm going for MWEs like</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">            </span><span class="sd">/// ```</span>
<span class="w">            </span><span class="sd">/// # use core_simd::*;</span>
<span class="w">            </span><span class="sd">/// let a = f32x4::from_array([-3.0, -0.0, 2.0, 0.0]);</span>
<span class="w">            </span><span class="sd">/// let b = f32x4::from_array([3.0, 0.0, 2.0, 0.0]);</span>
<span class="w">            </span><span class="sd">/// let c = f32x4::abs(a);</span>
<span class="w">            </span><span class="sd">/// assert_eq!(c, b);</span>
<span class="w">            </span><span class="sd">/// ```</span>
</code></pre></div>



<a name="241651490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241651490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241651490">(Jun 05 2021 at 19:00)</a>:</h4>
<p>mhm.</p>



<a name="241652186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241652186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241652186">(Jun 05 2021 at 19:17)</a>:</h4>
<p>Uuuh</p>



<a name="241652189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241652189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241652189">(Jun 05 2021 at 19:17)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">            </span><span class="sd">/// Rounds to the nearest integer value. Ties round toward zero.</span>
<span class="w">            </span><span class="sd">/// ```</span>
<span class="w">            </span><span class="sd">/// # use core_simd::*;</span>
<span class="w">            </span><span class="sd">/// let a = f32x4::from_array([-3.6, -0.5, 2.5, 0.6]);</span>
<span class="w">            </span><span class="sd">/// let b = f32x4::from_array([-4.0, 0.0, 2.0, 1.0]);</span>
<span class="w">            </span><span class="sd">/// let c = f32x4::round(a);</span>
<span class="w">            </span><span class="sd">/// assert_eq!(c, b);</span>
<span class="w">            </span><span class="sd">/// ```</span>
</code></pre></div>



<a name="241652250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241652250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241652250">(Jun 05 2021 at 19:18)</a>:</h4>
<p>Shouldn't <code>c == f32x4::from_array([-4.0, -1.0, 3.0, 1.0])</code> if <code>Ties round toward zero</code>?</p>



<a name="241652275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241652275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241652275">(Jun 05 2021 at 19:19)</a>:</h4>
<p>Because I'm getting back</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="o">----</span><span class="w"> </span><span class="n">src</span><span class="o">/</span><span class="n">round</span><span class="p">.</span><span class="n">rs</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">round</span>::<span class="k">crate</span>::<span class="n">SimdF64</span><span class="o">&lt;</span><span class="n">LANES</span><span class="o">&gt;</span>::<span class="n">round</span><span class="w"> </span><span class="p">(</span><span class="n">line</span><span class="w"> </span><span class="mi">112</span><span class="p">)</span><span class="w"> </span><span class="n">stdout</span><span class="w"> </span><span class="o">----</span><span class="w"></span>
<span class="n">Test</span><span class="w"> </span><span class="n">executable</span><span class="w"> </span><span class="n">failed</span><span class="w"> </span><span class="p">(</span><span class="n">exit</span><span class="w"> </span><span class="n">code</span><span class="w"> </span><span class="mi">101</span><span class="p">).</span><span class="w"></span>

<span class="n">stderr</span>:
<span class="nc">thread</span><span class="w"> </span><span class="o">'</span><span class="na">main</span><span class="o">'</span><span class="w"> </span><span class="n">panicked</span><span class="w"> </span><span class="n">at</span><span class="w"> </span><span class="o">'</span><span class="na">assertion</span><span class="w"> </span><span class="n">failed</span>: <span class="err">`</span><span class="p">(</span><span class="n">left</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">right</span><span class="p">)</span><span class="err">`</span><span class="w"></span>
<span class="w">  </span><span class="n">left</span>: <span class="err">`</span><span class="p">[</span><span class="o">-</span><span class="mf">4.0</span><span class="p">,</span><span class="w"> </span><span class="o">-</span><span class="mf">1.0</span><span class="p">,</span><span class="w"> </span><span class="mf">3.0</span><span class="p">,</span><span class="w"> </span><span class="mf">1.0</span><span class="p">]</span><span class="err">`</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="n">right</span>: <span class="err">`</span><span class="p">[</span><span class="o">-</span><span class="mf">4.0</span><span class="p">,</span><span class="w"> </span><span class="mf">0.0</span><span class="p">,</span><span class="w"> </span><span class="mf">2.0</span><span class="p">,</span><span class="w"> </span><span class="mf">1.0</span><span class="p">]</span><span class="err">`</span><span class="o">'</span><span class="p">,</span><span class="w"> </span><span class="n">src</span><span class="o">/</span><span class="n">round</span><span class="p">.</span><span class="n">rs</span>:<span class="mi">8</span>:<span class="mi">1</span><span class="w"></span>
</code></pre></div>



<a name="241652515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241652515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241652515">(Jun 05 2021 at 19:25)</a>:</h4>
<p>hmm?</p>



<a name="241652520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241652520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241652520">(Jun 05 2021 at 19:26)</a>:</h4>
<p>...hmm.</p>



<a name="241652572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241652572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241652572">(Jun 05 2021 at 19:26)</a>:</h4>
<p>try it with f64...</p>



<a name="241652580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241652580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241652580">(Jun 05 2021 at 19:27)</a>:</h4>
<p>brb</p>



<a name="241652732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241652732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241652732">(Jun 05 2021 at 19:30)</a>:</h4>
<p>NOPE, also fails with <code>f64x4</code></p>



<a name="241652746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241652746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241652746">(Jun 05 2021 at 19:31)</a>:</h4>
<p>I mean, I don't mind clarifying what <code>Ties round away from zero</code> is the default, I just think it should be consistent.</p>



<a name="241652814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241652814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241652814">(Jun 05 2021 at 19:33)</a>:</h4>
<p>Well that seems to be the Rust default anyways <span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span></p>



<a name="241652819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241652819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241652819">(Jun 05 2021 at 19:33)</a>:</h4>
<p>round away from zero is consistent with the normal float round in rust <a href="https://doc.rust-lang.org/std/primitive.f32.html#method.round">https://doc.rust-lang.org/std/primitive.f32.html#method.round</a></p>



<a name="241652870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241652870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241652870">(Jun 05 2021 at 19:34)</a>:</h4>
<p>Yeah, I just checked that in the Playgounr <span class="user-mention" data-user-id="209168">@Thom Chiovoloni</span>  - should I  ammend that docstring then?</p>



<a name="241652880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241652880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241652880">(Jun 05 2021 at 19:34)</a>:</h4>
<p>yes</p>



<a name="241652900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241652900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241652900">(Jun 05 2021 at 19:35)</a>:</h4>
<p>ohhh huh.</p>



<a name="241652949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241652949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241652949">(Jun 05 2021 at 19:36)</a>:</h4>
<p>Alright, seems like a good thing to straighten out in the docs then <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="241655017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241655017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241655017">(Jun 05 2021 at 20:30)</a>:</h4>
<p>Yeah doc tests not caching is quite painful right now...</p>



<a name="241655874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241655874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241655874">(Jun 05 2021 at 20:55)</a>:</h4>
<p>Can anyone help out with a MWE here? </p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">            </span><span class="sd">/// Returns a slice containing the entire SIMD vector.</span>
<span class="w">            </span><span class="sd">/// ```</span>
<span class="w">            </span><span class="sd">/// # use core_simd::*;</span>
<span class="w">            </span><span class="sd">/// let a = f32x4::from_array([1.0, 1.0, 1.0, 1.0]);</span>
<span class="w">            </span><span class="sd">/// let b = a.as_slice();</span>
<span class="w">            </span><span class="sd">/// let c = [1.0, 1.0, 1.0, 1.0];</span>
<span class="w">            </span><span class="sd">/// assert_eq!(c[0..3], b);</span>
<span class="w">            </span><span class="sd">/// ```</span>
<span class="w">            </span><span class="k">pub</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="k">fn</span> <span class="nf">as_slice</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="p">[</span><span class="cp">$type</span><span class="p">]</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                </span><span class="o">&amp;</span><span class="bp">self</span><span class="p">.</span><span class="mi">0</span><span class="w"></span>
<span class="w">            </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="241656123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241656123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241656123">(Jun 05 2021 at 21:02)</a>:</h4>
<p>that is technically accurate. ^^; I don't think there's anything to be done for that as far as examples go, it's just "returns a slice".</p>



<a name="241656192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241656192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241656192">(Jun 05 2021 at 21:04)</a>:</h4>
<p>Fair enough.</p>



<a name="241656262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241656262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241656262">(Jun 05 2021 at 21:06)</a>:</h4>
<p>Is this supposed to be a saturading add?</p>



<a name="241656271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241656271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241656271">(Jun 05 2021 at 21:07)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">            </span><span class="sd">/// Horizontal add.  Returns the sum of the lanes of the vector, with saturating addition.</span>
<span class="w">            </span><span class="sd">/// ```</span>
<span class="w">            </span><span class="sd">/// # use core_simd::*;</span>
<span class="w">            </span><span class="sd">/// let a = f32x4::from_array([1.0, 2.0, 3.0, 4.0]).horizontal_sum();</span>
<span class="w">            </span><span class="sd">/// assert_eq!(10.0, a);</span>
<span class="w">            </span><span class="sd">/// let b = f32x4::from_array([f32::MAX, 2.0, 0.0, 0.0]).horizontal_sum();</span>
<span class="w">            </span><span class="sd">/// assert_eq!(f32::MAX, b + 1.0);</span>
<span class="w">            </span><span class="sd">/// ```</span>
</code></pre></div>



<a name="241656401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241656401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241656401">(Jun 05 2021 at 21:11)</a>:</h4>
<p>So f32x4 addition saturates, and f32x4 multiplication wraps.</p>



<a name="241656627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241656627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241656627">(Jun 05 2021 at 21:18)</a>:</h4>
<p>How can this be <code>inf</code>?</p>



<a name="241656633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241656633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241656633">(Jun 05 2021 at 21:18)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="fm">assert_eq!</span><span class="p">(</span><span class="kt">f32</span>::<span class="n">inf</span><span class="p">,</span><span class="w"> </span><span class="n">f32x4</span>::<span class="n">from_array</span><span class="p">([</span><span class="kt">f32</span>::<span class="n">MAX</span><span class="p">,</span><span class="w"> </span><span class="mf">2.0</span><span class="p">,</span><span class="w"> </span><span class="mf">1.0</span><span class="p">,</span><span class="w"> </span><span class="mf">1.0</span><span class="p">]).</span><span class="n">horizontal_product</span><span class="p">())</span>:
</code></pre></div>



<a name="241656640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241656640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241656640">(Jun 05 2021 at 21:19)</a>:</h4>
<p>huh, that's odd.</p>



<a name="241656960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241656960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241656960">(Jun 05 2021 at 21:29)</a>:</h4>
<p>Well it's live now</p>



<a name="241656961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241656961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241656961">(Jun 05 2021 at 21:29)</a>:</h4>
<p><a href="https://github.com/rust-lang/stdsimd/pull/132">https://github.com/rust-lang/stdsimd/pull/132</a></p>



<a name="241657909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241657909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241657909">(Jun 05 2021 at 21:55)</a>:</h4>
<p><span class="user-mention" data-user-id="281757">@Jubilee</span> the opposite kinda: normal unit tests are all in one thing, integration tests are one test executable per top level module (like how bins/ and examples/ work), and doc tests are one test executable <em>per doctest comment block</em> (aka "bonkers slow")</p>



<a name="241657916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241657916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241657916">(Jun 05 2021 at 21:55)</a>:</h4>
<p>oh hm, I guess I was wrong.</p>



<a name="241658081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241658081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241658081">(Jun 05 2021 at 22:00)</a>:</h4>
<p>Meh, still only takes about 15 secs on a single thread. Its not too bad.</p>



<a name="241658101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241658101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241658101">(Jun 05 2021 at 22:00)</a>:</h4>
<p>I'm going for a walk, did some good coding today.</p>



<a name="241660415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241660415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241660415">(Jun 05 2021 at 23:08)</a>:</h4>
<p><span class="user-mention silent" data-user-id="246783">Miguel Raz Guzmán Macedo</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Docstring.20brigade/near/241658081">said</a>:</p>
<blockquote>
<p>Meh, still only takes about 15 secs on a single thread. Its not too bad.</p>
</blockquote>
<p>yeah but unit/integration tests are like 100x faster to run through than doctests</p>



<a name="241660441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241660441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241660441">(Jun 05 2021 at 23:09)</a>:</h4>
<p>Oh, gotcha.</p>



<a name="241660521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241660521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241660521">(Jun 05 2021 at 23:11)</a>:</h4>
<p>linking is just so expensive by default that linking 100 small things is way more costly than linking one big thing.</p>



<a name="241660638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241660638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241660638">(Jun 05 2021 at 23:14)</a>:</h4>
<p>... Y'all <em>really</em> need to port <code>mold</code> asap.</p>



<a name="241660645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241660645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241660645">(Jun 05 2021 at 23:14)</a>:</h4>
<p><a href="https://github.com/rui314/mold#how-to-use">https://github.com/rui314/mold#how-to-use</a></p>



<a name="241660934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241660934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241660934">(Jun 05 2021 at 23:23)</a>:</h4>
<p>sure, just as soon as it works on anything but linux/x86_64 :P</p>



<a name="241660983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241660983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241660983">(Jun 05 2021 at 23:24)</a>:</h4>
<p>... or RIIR would probs be better no?</p>



<a name="241661138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241661138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241661138">(Jun 05 2021 at 23:28)</a>:</h4>
<p>Are masks obtained from <code>lanes_eq</code> and friends always lane-sized?</p>



<a name="241661140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241661140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241661140">(Jun 05 2021 at 23:28)</a>:</h4>
<p>no, it's not even done yet. It's a tool, it doesn't have to be written in rust, we just call it as a tool.</p>



<a name="241661148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241661148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241661148">(Jun 05 2021 at 23:28)</a>:</h4>
<p><span class="user-mention silent" data-user-id="246783">Miguel Raz Guzmán Macedo</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Docstring.20brigade/near/241661138">said</a>:</p>
<blockquote>
<p>Are masks obtained from <code>lanes_eq</code> and friends always lane-sized?</p>
</blockquote>
<p>they are, yeah, each lane of the mask will be trueish or falseish</p>



<a name="241661159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241661159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241661159">(Jun 05 2021 at 23:29)</a>:</h4>
<p>so the entire lane will be filled with 1s or 0s, right?</p>



<a name="241661162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241661162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241661162">(Jun 05 2021 at 23:29)</a>:</h4>
<p>yeah, f32x4.lanes_eq(f32x4) will give like mask32x4 where each mask32 is all 0 or all 1</p>



<a name="241661164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241661164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241661164">(Jun 05 2021 at 23:29)</a>:</h4>
<p>Ok ok.</p>



<a name="241661208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241661208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241661208">(Jun 05 2021 at 23:30)</a>:</h4>
<p>uh, assuming that the masks discussion got sorted out how i remember it</p>



<a name="241661211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241661211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241661211">(Jun 05 2021 at 23:30)</a>:</h4>
<p>On some architectures it's only 1 bit per lane</p>



<a name="241661219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241661219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241661219">(Jun 05 2021 at 23:30)</a>:</h4>
<p>oops, this is why we pay caleb the big bucks</p>



<a name="241661220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241661220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241661220">(Jun 05 2021 at 23:30)</a>:</h4>
<p>"some" right now being only avx-512 but probably others in the future</p>



<a name="241661282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241661282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241661282">(Jun 05 2021 at 23:32)</a>:</h4>
<p>That sounds like something that I should include in the docstrings...</p>



<a name="241661287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241661287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241661287">(Jun 05 2021 at 23:32)</a>:</h4>
<p>The layout of the masks in general are unspecified</p>



<a name="241661298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241661298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241661298">(Jun 05 2021 at 23:33)</a>:</h4>
<p>So I wouldn't get too specific about them in general.  They're just collections of truthy values</p>



<a name="241661301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241661301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241661301">(Jun 05 2021 at 23:33)</a>:</h4>
<p>that, yes.</p>



<a name="241661350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241661350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241661350">(Jun 05 2021 at 23:34)</a>:</h4>
<p>Notionally they are <code>[bool; N]</code>.</p>



<a name="241661930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241661930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241661930">(Jun 05 2021 at 23:51)</a>:</h4>
<p>[truthy; N]</p>



<a name="241662052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241662052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241662052">(Jun 05 2021 at 23:54)</a>:</h4>
<p><code>Into&lt;[bool; N]&gt;</code></p>



<a name="241662347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241662347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241662347">(Jun 06 2021 at 00:02)</a>:</h4>
<p>Yeah, masks specifically have a value of <code>0</code> or <code>!0</code> for every lane, I should say.</p>



<a name="241662437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241662437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241662437">(Jun 06 2021 at 00:05)</a>:</h4>
<p>Since the interface is bool I think it's fair to consider them bools, they just aren't directly mutable</p>



<a name="241663381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241663381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241663381">(Jun 06 2021 at 00:30)</a>:</h4>
<p>is it safe to assume that masks have only 2^N states though? It might be N full words with some truthy function</p>



<a name="241663383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241663383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241663383">(Jun 06 2021 at 00:30)</a>:</h4>
<p>Yes</p>



<a name="241663399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241663399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241663399">(Jun 06 2021 at 00:31)</a>:</h4>
<p>In LLVM it's truncated to <code>&lt;i1 x N&gt;</code> before using it</p>



<a name="241663401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241663401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241663401">(Jun 06 2021 at 00:31)</a>:</h4>
<p>So only 1 bit per lane</p>



<a name="241664342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241664342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241664342">(Jun 06 2021 at 01:00)</a>:</h4>
<p>Why doesn't this docstring<br>
<a href="https://rust-lang.github.io/stdsimd/src/core_simd/select.rs.html#87">https://rust-lang.github.io/stdsimd/src/core_simd/select.rs.html#87</a></p>



<a name="241664343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241664343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241664343">(Jun 06 2021 at 01:00)</a>:</h4>
<p>Show up here</p>



<a name="241664355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241664355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241664355">(Jun 06 2021 at 01:01)</a>:</h4>
<p><a href="https://rust-lang.github.io/stdsimd/src/core_simd/select.rs.html#85">https://rust-lang.github.io/stdsimd/src/core_simd/select.rs.html#85</a></p>



<a name="241664367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241664367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241664367">(Jun 06 2021 at 01:01)</a>:</h4>
<p>It's not accessible via the sidebar either  <span aria-label="sad" class="emoji emoji-2639" role="img" title="sad">:sad:</span></p>



<a name="241664372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241664372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241664372">(Jun 06 2021 at 01:01)</a>:</h4>
<p>aka if I look for <code>select</code> in the docs in doesn't show up</p>



<a name="241664978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241664978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241664978">(Jun 06 2021 at 01:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="312331">Caleb Zulawski</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Docstring.20brigade/near/241662437">said</a>:</p>
<blockquote>
<p>Since the interface is bool I think it's fair to consider them bools, they just aren't directly mutable</p>
</blockquote>
<p>incidentally though, if you convert a &amp;[SimdMask] to &amp;[bool], even adjusting for length, you'd be causing UB if any of the mask lanes were "trueish", because when those bytes are viewed as a <code>bool</code> it's an improper value (it would be <code>0b1111_1111</code>, not <code>0b0000_0001</code>).</p>



<a name="241665048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241665048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241665048">(Jun 06 2021 at 01:20)</a>:</h4>
<p>Yeah, we don't provide any slice access at all though</p>



<a name="241665052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241665052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241665052">(Jun 06 2021 at 01:21)</a>:</h4>
<p>Just <code>fn get(self, index: usize) -&gt; bool</code> etc</p>



<a name="241667046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241667046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241667046">(Jun 06 2021 at 02:22)</a>:</h4>
<p><span class="user-mention silent" data-user-id="246783">Miguel Raz Guzmán Macedo</span> <a href="#narrow/stream/257879-project-portable-simd/topic/Docstring.20brigade/near/241664372">said</a>:</p>
<blockquote>
<p>aka if I look for <code>select</code> in the docs in doesn't show up</p>
</blockquote>
<p>where in the docs are you looking? with the search engine?</p>



<a name="241667371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241667371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241667371">(Jun 06 2021 at 02:32)</a>:</h4>
<p><span class="user-mention" data-user-id="281757">@Jubilee</span> yes, I go to <a href="https://rust-lang.github.io/stdsimd/core_simd/trait.Select.html">https://rust-lang.github.io/stdsimd/core_simd/trait.Select.html</a></p>



<a name="241667374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241667374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241667374">(Jun 06 2021 at 02:32)</a>:</h4>
<p>Then I type in <code>select</code> in the search bar, and click the first result.</p>



<a name="241667380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Docstring%20brigade/near/241667380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Miguel Raz Guzmán Macedo <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Docstring.20brigade.html#241667380">(Jun 06 2021 at 02:32)</a>:</h4>
<p>oh FML, I'm being silly and clicking on a trait and not a method.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>